{extend name="common/base"}
{block name='title'}修改密码{/block}
{block name='body-type'}admin_edit{/block}
{block name="content"}
        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">修改密码</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">

                                <form enctype="multipart/form-data" class="am-form tpl-form-border-form tpl-form-border-br" action="{:Url('admin/common/update_admin')}?admin_id={$admin['id']}" method="post">
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">账号 </label>
                                        <div class="am-u-sm-9">
                                            <input type="text" name="account" class="tpl-form-input" id="user-name" placeholder="请输入账号" value="{$admin['account']}" readonly="readonly">
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">原密码 </label>
                                        <div class="am-u-sm-9">
                                            <input type="password" name="used_password" class="tpl-form-input" id="user-name" placeholder="请输入原密码">
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">新密码 </label>
                                        <div class="am-u-sm-9">
                                            <input type="password" name="password" class="tpl-form-input" id="user-name" placeholder="请输入新密码">
                                        </div>
                                    </div>
                                    
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">确认新密码 </label>
                                        <div class="am-u-sm-9">
                                            <input type="password" name="repassword" class="tpl-form-input" id="user-name" placeholder="请再次输入新密码">
                                        </div>
                                    </div>



                                    <div class="am-form-group">
                                        <div class="am-u-sm-9 am-u-sm-push-3">
                                            <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>



            </div>
        </div>
        {/block}
        {block name="footer-js"}
        <script>
            function upimg(obj)
          {
            if( obj.value == "" ) {
              return;
            }
            var formdata = new FormData(); 
            formdata.append("src" , $(obj)[0].files[0]);//获取文件法二
            $.ajax({
              type : 'post',
              url : "{:Url('admin/admin/upimg')}",
              data : formdata,
              cache : false,
              processData : false, // 不处理发送的数据，因为data值是Formdata对象，不需要对数据做处理
              contentType : false, // 不设置Content-type请求头
              success : function(ret){
                $('#img-view-box').attr('src', ret.src);
                $('#img-value-box').val(ret.src);

                  //alert(obj.value);
              },
              error : function(){ }
            });
          }

        </script>
        {/block}